﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;

namespace MsgSender.models
{
    /// <summary>
    /// 基本操作
    /// </summary>
    /// <typeparam name="BaseModel"></typeparam>
    public interface IBaseModel<T>
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <returns></returns>
         bool Add();
        
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
         bool Update();

        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
         bool Delete();

        /// <summary>
        /// 获取单个
        /// </summary>
        /// <returns></returns>
         T Get();
    }

    /// <summary>
    /// 所有Model基类
    /// </summary>
    abstract public class BaseModel<T>{
        protected ILog _logModel = null;
        public BaseModel() {
            _logModel = LogManager.GetLogger(this.GetType());
        }

        abstract public bool Add();
        abstract public bool Update();
        abstract public bool Delete();
        abstract public T Get();

    }
}
